import numpy as np
import matplotlib.pyplot as plt


# Fixing random state for reproducibility
np.random.seed(19680801)

N = 50
x = np.random.rand(N)
y = np.random.rand(N)
colors = np.random.rand(N)  # 颜色可以随机
area = (30 * np.random.rand(N)) ** 2  # 随机大小
# x，y，s，c 的 size 需要一致
plt.scatter(x, y, s=area, c=colors, alpha=0.5)
plt.show()

# 多元高斯的情况
# 设置画布大小
fig = plt.figure(figsize=(8, 6))
# Generating a Gaussion dataset:
# creating random vectors from the multivariate normal distribution
# given mean and covariance
mu_vec1 = np.array([0, 0])
cov_mat1 = np.array([[1, 0], [0, 1]])
X = np.random.multivariate_normal(mu_vec1, cov_mat1, 500)
R = X ** 2
R_sum = R.sum(axis=1)
plt.scatter(X[:, 0], X[:, 1], c='green', marker='o', s=32. * R_sum, edgecolor='black', alpha=0.5)

plt.show()
